const mongoose = require('mongoose')
mongoose.set('useFindAndModify', false)
const commentSchema = new mongoose.Schema({
    user: { //关联用户表
        type: mongoose.Schema.Types.ObjectId, //类型
        ref: 'user' //引用
    },
    message: String, //信息
    color: String, //文字颜色
    img: Array, //动态的图片
    browse: {
        type: Number,
        default: 0
    }, //浏览量
    comment: { //评论
        type: Array,
        default: []
    },
    great: Array, //点赞的用户       
})
module.exports = mongoose.model('comment', commentSchema)